<template>
    <el-row style="height:100%">
        <el-card class="box-card">
            <template #header>
                <div class="card-header">
                    <span>查询</span>
                </div>
            </template>
            <el-row :gutter="2">
                <span style="margin:auto 0;">姓名</span>
                <el-col :span="3"><el-input v-model="filter.name" placeholder="请输入"/></el-col>
                <span style="margin:auto 0">单位</span>
                <el-col :span="3"><el-input v-model="filter.unit" placeholder="请输入"></el-input></el-col>
                <span style="margin:auto 0">请求时间</span>
                <el-col :span="2" >
                    <el-date-picker
                        v-model="filter.range"
                        type="daterange"
                        start-placeholder="开始日期"
                        end-placeholder="结束日期"
                        range-separator="至"
                    />
                </el-col>
                <el-col :span='2' :offset='7' justify="end">
                    <el-button type="success">查询</el-button>
                </el-col>
            </el-row>
        </el-card>
        <el-card class="box-card" style="height: 100%;">
            <template #header>
                <div class="card-header">
                    <span>日志管理</span>
                </div>
            </template>
            <el-table :data="tableData" highlight-current-row border style="width: 100%">
                <el-table-column prop="index" label="序列" />
                <el-table-column prop="name" label="姓名" />
                <el-table-column prop="unit" label="单位" />
                <el-table-column prop="role" label="角色" />
                <el-table-column prop="operate" label="执行操作" />
                <el-table-column prop="time" label="请求时间" />
            </el-table>
        </el-card>
    </el-row>
</template>

<script>
import {ref} from 'vue'
export default {
    setup(){
        let tableData=ref([
                {
                    index: '1',
                    name: 'XX',
                    unit: 'XX',
                    role:'管理员',
                    operate:'新增',
                    time:'2023'
                },
            ])
        window.cefQueryRequset('log','query', {},(res,data)=>{
            if(res && data instanceof Array && data.length) {
                tableData.value = tableData.value.concat(data)
            }
        })
        return {tableData}
    },
    data(){
        return {
            filter:{
                name:'',
                unit:'',
                range:''
            },
        }
    },
    methods:{
       
    }
}
</script>

<style scoped>
.box-card{
    width: 100%;
}
</style>